package com.seven.springcloud.service;

import com.seven.springcloud.entity.CommonResult;
import com.seven.springcloud.entity.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.concurrent.TimeUnit;

@Component
//你要获取的服务列表名
@FeignClient("CLOUD-PAYMENT-SERVICE")
@RequestMapping("payment/")
public interface FeignPaymentService {
    @GetMapping("get/{id}")
    public CommonResult<Payment> get(@PathVariable("id") Long id);

    @GetMapping("feign/timeout")
    public String timeout();
}
